package com.zhxy.util.test;

import static org.ops4j.pax.exam.CoreOptions.equinox;
import static org.ops4j.pax.exam.CoreOptions.frameworks;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.systemProperty;
import static org.ops4j.pax.exam.CoreOptions.vmOption;
import static org.ops4j.pax.exam.CoreOptions.when;

import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.ExamReactorStrategy;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactorFactory;

@RunWith(JUnit4TestRunner.class)
@ExamReactorStrategy(EagerSingleStagedReactorFactory.class)
public class OsgiTestSuit {

	@Configuration
	public Option[] config() {
		System.out.println("!!!!!!!!!!!!!!!!--------config-------!!!!!!!!!!!!");
		Option debugOption = when(Boolean.getBoolean("isDebugEnabled"))
				.useOptions(
						vmOption("-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005"));
		return options(
				frameworks(equinox().version("3.7.0")),
				debugOption,
				systemProperty("maven.home").value(
						"D:\\bin\\apache-maven-3.0.1"));
	}
}
